package ticketmachine.dataObjects;

import java.util.Collection;
import java.util.HashMap;

import ticketmachine.gui.NewTicketView;
import ticketmachine.logic.Station;
import ticketmachine.logic.TicketDescription;
import ticketmachine.logic.TicketMachineFacade;

public class StationDAO implements IStationDAO {

    private HashMap <Integer,Station> stationList;

    public StationDAO() {
        
    	stationList = new HashMap <Integer,Station>();
    }
	
	public Station getStationById(int stationId)
	{
        Station station = stationList.get(stationId);

        return station;
	}
	
	public Collection<Station> listStations()
	{
		return stationList.values();
	}
	
	public Station createStation(String name, String address, int previous, int next)
	{
		int newId = stationList.values().size();
		
		Station s = new Station(newId, name, address,previous,next);
		
		stationList.put(newId, s);

		return s;
	}
	
	  public static void main(String[] args) {

	        StationDAO s=new StationDAO();
	        System.out.println(StationDAO.class);
	        
	    }


}
